package com.example.safeassistan.home.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.safeassistan.R;

import java.util.List;

public class ImageListAdapter extends BaseQuickAdapter<String,BaseViewHolder> {
    public ImageListAdapter(@Nullable List data) {
        super(R.layout.item_picture, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        ImageView ivBgImage=helper.getView(R.id.ivBgImage);
        Glide.with(mContext).load(item)
                .placeholder(R.mipmap.default_image)
                .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10))).
        into(ivBgImage);
    }
}